places sidebar: keep open variants sensitive
authorMatthias Clasen <mclasen@redhat.com>
Sun, 13 Sep 2015 16:44:17 +0000 (12:44 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 13 Sep 2015 16:44:17 +0000 (12:44 -0400)
Add a separate action for "Open in Tab" and "Open in new window"
so we can keep them enabled when we disable "Open" for the selected
row.

https://bugzilla.gnome.org/show_bug.cgi?id=754410

gtk/gtkplacessidebar.c

index 7c3d52ae4f245bd39e42b5b0e07239f53336c200..dc20ca4f1c991abeb48bb13fed19462ead37f556 100644 (file)
@@ -3257,6 +3257,7 @@ on_key_press_event (GtkWidget        *widget,
 
 static GActionEntry entries[] = {
   { "open", open_shortcut_cb, "i", NULL, NULL },
+  { "open-other", open_shortcut_cb, "i", NULL, NULL },
   { "bookmark", add_shortcut_cb, NULL, NULL, NULL },
   { "remove", remove_shortcut_cb, NULL, NULL, NULL },
   { "rename", rename_shortcut_cb, NULL, NULL, NULL },
@@ -3325,7 +3326,7 @@ add_open_button (GtkWidget          *box,
 
   item = g_object_new (GTK_TYPE_MODEL_BUTTON,
                        "visible", TRUE,
-                       "action-name", "row.open",
+                       "action-name", flags == GTK_PLACES_OPEN_NORMAL ? "row.open" : "row.open-other",
                        "action-target", g_variant_new_int32 (flags),
                        "text", label,
                        NULL);